﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsGame1
{
    public class StateWait : State
    {
        public float duration;
        public float timeleft;
        bool firstrun = true;

        public StateWait(Alien a, float duration = 1)
            : base(a)
        {
            this.duration = duration;
        }

        public override bool Update(Timer t)
        {
            if (firstrun)
            {
                firstrun = false;
                timeleft = duration;
            }

            timeleft -= t.Delta;
            bool r = timeleft > 0;

            if (r == false)
                timeleft = duration;

            return r;
        }
    }
}
